<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html>
<html lang="zh-CN">
  
  <head>
    
    <%@ include file="/WEB-INF/include/meta.jsp"%>
    <%@ include file="/WEB-INF/include/css.jsp"%>
    
  </head>
  <!-- end header -->
  <body>
    <div class="page-group">
      <div class="page page-current">
        
        <div class="content">
        
          <div class="physical-warpper">
            
            <div class="physical-logo">
              <img src="" alt="">
            </div>

            <div class="physical-card">
              
              <h1 class="card-title">告诉我你的基本情况，一起减减肥！</h1>

              <form action="${ctx.host}/physical-exam" method="post">
                
                <input type="hidden" name="nickname" value = "${phsicalExamForm.nickname}">
                <input type="hidden" name="height" value = "${phsicalExamForm.height}">
                <input type="hidden" name="weight" value = "${phsicalExamForm.weight}">
                <input type="hidden" name="birthday" value = "<fmt:formatDate value="${phsicalExamForm.birthday}" pattern="yyyy-MM-dd"/>">
                <input type="hidden" name="sex" value = "${phsicalExamForm.sex}">
                <input type="hidden" name="physiology" value = "${phsicalExamForm.physiology}">
                
                <div class="form-item no-border" style="height: auto;">
                  <label class="form-label">现在的体型：</label>
                  <div class="shape-wrapper label-select-wrapper content-padded">
                    <div class="row">
                      <c:choose>
                        <c:when test="${phsicalExamForm.sex eq 'MALE'}">
                          <c:forEach var="fat" items="${enums['fat']}">
                            <c:if test="${fat.male}">
                              <div class="col-33">
                                <label class="label-select">
                                  <img class="label" src="${fat.icon}" alt="">
                                  <input class="select" type="radio" name="fat" value="${fat}">
                                </label>
                              </div>
                            </c:if>
                          </c:forEach>
                        </c:when>
                        <c:otherwise>
                          <c:forEach var="fat" items="${emnus['fat']}">
                            <c:if test="${not fat.male}">
                              <div class="col-33">
                                <label class="label-select">
                                  <img class="label" src="${fat.icon}" alt="">
                                  <input class="select" type="radio" name="fat" value="${fat}">
                                </label>
                              </div>
                            </c:if>
                          </c:forEach>
                        </c:otherwise>
                      </c:choose>
                    </div>
                  </div>

                  <label class="form-label">我的运动量：</label>
                  <div class="label-select-wrapper">
                    <div class="row">
                      <c:forEach var="exercise" items="${enums['exercise']}">
                        <c:if test="${exercise.display}">
                          <div class="col-33">
                            <label class="label-select">
                              <i class="tag label">${exercise.description}</i>
                              <input class="select" type="radio" name="exercise" value="${exercise}">
                            </label>
                          </div>
                        </c:if>
                      </c:forEach>
                    </div>
                  </div>

                </div>
                
                <a href="javascript:void(0);" class="physical-button button button-big button-fill button-gray disabled js-submit" style="margin-bottom: 2rem;">还没完？！</a>

              </form>

            </div>

          </div>
        
        </div>
        <!-- End Content -->
        
      </div>
    </div>
    
    <%@ include file="/WEB-INF/include/script.jsp"%>
    <d:resource type="script" root="${ctx.resource}/build" src="js/page/physical/shape.js" />
    <script type="text/javascript">
      require(['page/physical/shape'], function(page) {
        page.init()
      })
    </script>
    
  </body>
</html>